package com.example.config.appscheduledtasks;

import com.example.service.appservice.AppForumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @BelongsProject："smart-property"
 * @BelongsPackage："com.example.config.appscheduledtasks"
 * @CreateTime："2022-11-18 08:54"
 * @Description：定时全查
 * @Author：LK
 */
@Component
@EnableScheduling
public class FullInspectionTask {

    @Autowired
    private AppForumService appForumService;

    /**
     * @description:每天00：00执行查询，结果放到redis
     * @author: lk
     * @date: 2022/11/18 9:02
     **/
    @Bean
    @Scheduled(cron = "0 0/5 * * * ?")
    public void allCheck(){
        appForumService.postsRedisCheck();
    }
}
